import service from '@/utils/request';


export const getSuperNodeList = (pageIndex = 1, pageSize = 10,keyWord) => {
    return service({
        url: '/node/listNode',
        method: 'get',
        params: {
            pageIndex,
            pageSize,
            keyWord
        },
    });
}

export const registerSuperNode = (data) => {
    return service({
        url: '/node/regisNode',
        method: 'post',
        data
    });
};

export const updataNodeInfo = (data) => {
    return service({
        url: '/node/updateNodeInfo',
        method: 'post',
        data
    });
};

export const updateAuthorizationCode = (nodeId, authorizationCode) => {
    return service({
        url: '/node/updateAuthCode',
        method: 'post',
        data: {
            NodeId: nodeId,
            AuthorizationCode: authorizationCode,
        },
    });
};

// 获取节点用户信息的 API 调用函数
export const getNodeUserInfo = (userId) => {
    return service({
        url: '/node/getNodeUserInfo',
        method: 'get',
        params: { userID: userId } // 将 UserID 作为查询参数传递
    });
};


export const getNodeMonitor = (pageIndex = 1, pageSize = 10,nodeId) => {
    return service({
        url: `/node/getNodeMonitor`,
        method: 'get',
        params: {
            pageIndex,
            pageSize,
            NodeId: nodeId } // 将 NodeId 作为查询参数传递
    });
};

export const deleteNode = (nodeId) => {
    return service({
        url: `/node/deleteNode`,
        method: 'post',
        params: {
            NodeId: nodeId }
    });
};

// 获取节点软件信息的 API 调用函数
export const getNodeSoftWare = (pageIndex,pageSize,nodeId) => {
    return service({
        url: '/node/getNodeSoftWare',
        method: 'get',
        params: { pageIndex,pageSize,NodeId: nodeId } // 将 NodeId 作为查询参数传递
    });
};

// 获取节点硬件信息的 API 调用函数
export const getNodeHardWare = (pageIndex,pageSize,nodeId) => {
    return service({
        url: '/node/getNodeHardWare',
        method: 'get',
        params: { pageIndex,pageSize,NodeId: nodeId } // 将 NodeId 作为查询参数传递
    });
};

